all: test_libmongoc.out test_libmongoc_my.out test_search_h.out test_search_h_gnu.out test_sys_queue_h.out test_sys_queue_h_double_linked.out

COMMON = common.h common.c
COMMON_OPT = -O0 -g -D _GNU_SOURCE=''

test_libmongoc.out: test_libmongoc.c
	gcc $(COMMON_OPT) -o test_libmongoc.out test_libmongoc.c `pkg-config --cflags libbson-1.0` `pkg-config --cflags libmongoc-1.0` `pkg-config --libs libmongoc-1.0` `pkg-config --libs libbson-1.0`

test_libmongoc_my.out: test_libmongoc_my.c $(COMMON)
	gcc $(COMMON_OPT) -o test_libmongoc_my.out test_libmongoc_my.c common.c `pkg-config --cflags libbson-1.0` `pkg-config --cflags libmongoc-1.0` `pkg-config --libs libmongoc-1.0` `pkg-config --libs libbson-1.0`
	
test_sys_queue_h.out: test_sys_queue_h.c $(COMMON)
	gcc $(COMMON_OPT) -o test_sys_queue_h.out test_sys_queue_h.c common.c 
	
test_sys_queue_h_double_linked.out: test_sys_queue_h_double_linked.c $(COMMON)
	gcc $(COMMON_OPT) -o test_sys_queue_h_double_linked.out test_sys_queue_h_double_linked.c common.c

test_search_h.out: test_search_h.c $(COMMON)
	gcc $(COMMON_OPT) -o test_search_h.out test_search_h.c common.c 

test_search_h_gnu.out: test_search_h_gnu.c $(COMMON)
	gcc $(COMMON_OPT) -o test_search_h_gnu.out test_search_h_gnu.c common.c 

.PHONY : clean
clean:
	-rm test_libmongoc.out test_libmongoc_my.out

